package com.springboot.SpringBoot1.web;

import com.springboot.SpringBoot1.service.MemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/***
 * 演示异步调用
 */
@RestController
@Slf4j
public class MemberController {
    @Autowired
    private MemberService memberService;
    @Value("${name}")
    private String name;

    @RequestMapping("/addMemberAndEmail")
    public String addMemberAndEmail(){
      log.info("1");
      String result = memberService.addMemberAndEmail();
      log.info("4");
      return  result;
    }
    @RequestMapping("/getName")
    public String getName(){

        return  name;
    }


}
